#!/bin/bash

# 1. 修改 meetcha-prod-java-conf 中 redis的配置

kubectl apply -f /root/MigrateRedis.d/meetchat-prod-java-conf-v2.yaml
if [ $? -ne 0 ];then
    echo "修改redis配置错误"
fi



# 2. 更新pod:  athena、game、union、chat、gateway、job、op、recharge、user

kubectl rollout restart deploy meetcha-prod-java-op-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "op更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-union-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "union更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-athena-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "athena更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-game-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "game更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-chat-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "chat更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-gateway-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "gateway更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-job-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "job更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-recharge-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "recharge更新错误"
fi
sleep 1
kubectl rollout restart deploy meetcha-prod-java-user-v1 -n meetcha-prod
if [ $? -ne 0 ];then
    echo "user更新错误"
fi